package cn.sciento.farm.devicemanager.api.jsonrpc;

import cn.sciento.farm.devicemanager.dao.entity.DevWaterFertilizer;
import cn.sciento.farm.devicemanager.dao.model.FertilizerConfig;
import cn.sciento.farm.devicemanager.dao.model.ResponseMessage;
import com.googlecode.jsonrpc4j.JsonRpcMethod;
import com.googlecode.jsonrpc4j.JsonRpcService;

/**
 * 文丘里水肥机
 */
@JsonRpcService("rpc/hardware.fertilizer")
public interface FertilizerJsonApi{

    ResponseMessage create(DevWaterFertilizer waterFertilizer);

    ResponseMessage update(DevWaterFertilizer waterFertilizer);

    ResponseMessage get( Long id);

    ResponseMessage delete(Long id);

    ResponseMessage list( Integer areaId);

    @JsonRpcMethod("get_channel_list")
    ResponseMessage getChannelList( String eui);

    @JsonRpcMethod("config_fertilizer")
    ResponseMessage configFertilizer(FertilizerConfig config);

    ResponseMessage control(Long id,Integer en ,String type );

    @JsonRpcMethod("set_fertilizer_ratio")
    ResponseMessage setFertilizerRatio(Long id,  Float ratio );

    @JsonRpcMethod("control_main")
    ResponseMessage controlMain(Long id,Integer time,Integer en);
}
